<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<%@ page import="com.hline.kbcss.MyDriver"%>
<%String uname=(String)session.getAttribute("uname");
String userid=(String)session.getAttribute("userid");

%>

<%
Statement st=MyDriver.getConnection("READ");

String title=request.getParameter("title");
String tech=request.getParameter("tech");
String content=request.getParameter("content");

PreparedStatement pst=null;
pst=MyDriver.getPrepare("insert into articles values(null,?,?,?,?,null,?,?)");
    pst.setString(1,title);
	pst.setString(2,tech);
	pst.setString(3,content);
	pst.setString(4,userid);
	pst.setInt(5,0);
	pst.setInt(6,0);
	int i=pst.executeUpdate();
	if(i>0)
	{
	response.sendRedirect("articles.jsp?message=<font color=#3366CC>Your File Posted Successfully</font>");
	}
	else
	{
		response.sendRedirect("postarticls.jsp?message=<font color=red>not added,please try again!!</font>");
	}
%>
</body>
</html>